// components/train-round/trainRound.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    totalRound: {
      type: Number,
      value: ''
    },
    playingIdx: {
      type: Number,
      value: '',
      observer (playingIdx) {
        this.setData({
          curRound: Math.floor(playingIdx / 2)
        })
      }
    },
    disabledChange: {
      type: Boolean,
      value: false
    }
  },

  options: {
    addGlobalClass: true,
  },
  /**
   * 组件的初始数据
   */
  data: {
    curRound: ''
  },

  /**
   * 组件的方法列表
   */
  methods: {
    setValue (e) {
      this.triggerEvent('playTarget', {index: e.detail.value * 2}, {})
    }
  }
})
